package com.ljm.boot.seataorderdetails.config;

import io.seata.core.context.RootContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//@Component
public class SeataInterceptor implements HandlerInterceptor {

//    private static final Logger log = LoggerFactory.getLogger(SeataInterceptor.class);
//
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
//        String xid = request.getHeader(RootContext.KEY_XID);
//        log.info("接收到请求，XID: {}", xid);
//        if (xid != null) {
//            RootContext.bind(xid);
//        }
//        return true;
//    }
}